package com.android.settings.audio.peq.util;

import android.content.Context;
import android.text.TextUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class NameString {

	static public String UPDATE_APP="UPDATE_APP";


	public String GUIDE_RIGHT_SCROLL="GUIDE_RIGHT_SCROLL";
	static public String DEFAULT_PIC_SHOW="DEFAULT_PIC_SHOW";
	static public String DOP="DOP";
	static public String DOP_OUTPUT = "DOP_output";
	public static String Limit_size = "LIMIT_SIZE"; // 限制大小
	public static String Limit_length = "LIMIT_LENGTH"; // 限制長度
	public static String Scan_appoint = "SCAN_APPOINT"; //指定文件夹扫揿
	public static String Filter_file = "FILTER_FILE";//过滤非歌曲文件和不含歌曲的文件夹
	static public String GUIDE_2="GUIDE_2";
	static public String isPlayLastSong="s_isPlayLastSong";
//	public static String sampling = "SAMPLING"; //固定采样率输凿
//	public static String sampling_check = "SAMPLING_CHECK";
	public static String file_skip = "FILE_SKIP"; //文件夹跳曲
	public static String album_skip = "ALBUM_SKIP"; //专辑夹跳曲

	public static String line_ctrl = "LINECTRL";//线控
	public static String current_language = "CURRENT_LANGUAGE";
	public static String drive_mode = "DRIVE_MODE";
	public static String Configuration = "CONFIGURATION_SYS";
	public static String synchronization_to_otg = "SYNCHRONIZATION_TO_OTG";
//	public static String Volumn_Mode = "VOLUMN_MODE";
	public static String Create_M3U_Playlist = "CREATE_M3U_PLAYLIST";

	public static String AUTO_MATCH = "auto_match";
	public static String SONY_DATA = "sony_mobile_data";
	public static String SYSTEM_APP = "system_app";
	public static String FONT_SIZE_SETTINGS = "font_size_settings";
	public static String NOTIFICATION_SET ="notification_settings";
	public static String USB_SAMPLE_BIT = "USB_SAMPLE_BIT"; //USB AUDIO 位深
	public static String DSD_AUDIO_VOLUME_LOCK = "DSD_AUDIO_VOLUME_LOCK"; //USB AUDIO音量锁定
	public static String USB_AUDIO_WORK_MODE = "usb_audio_work_mode"; //USB AUDIO性能模式
	public static String USB_SPEED = "USB_SPEED"; //USB AUDIO总线速度
	public static String DSD_COMPENSATE = "DSD_COMPENSATE"; //USB AUDIO DSD增益
	public static String RESET_ALT = "USB_RESET_ALT"; //

	static public String getResoucesString(Context mContext,int id) {
		if(mContext!=null)
			return mContext.getResources().getString(id);
		return "";
	}

	static public String getResoucesString(Context mContext,int id,int otherId) {
		if(mContext!=null)
			return mContext.getResources().getString(id,mContext.getResources().getString(otherId));
		return "";
	}

	static public int getCharacterPosition(String string) {
		// 这里是获叿/"符号的位罿
		Matcher slashMatcher = Pattern.compile("/").matcher(string);
		int mIdx = 0;
		while (slashMatcher.find()) {
			mIdx++;
			// 彿/"符号第三次出现的位置
			if (mIdx == 3) {
				break;
			}
		}
		return slashMatcher.start();
	}

	public static String getemailname(String email){
		if(email==null)
			return null;
		if(TextUtils.isEmpty(email)){
			return null;
		}
		String[] split = email.split("@");
		return split[0];
	}
}
